# smake
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../../func
. ../../build.conf

URL=http://sourceforge.net/projects/s-make/files
PKG=smake
VER=1.2.5
COMP=tar.gz
DESC="smake - maintain, update, and regenerate programs"
DEPS=
CAT=BuildingBlock
DESKTOP=smake.desktop
BUILD=
CWD=$(pwd)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 
		FLAGS=$CF64;;
 arm*)	LIBDIR=$LIBCONFarm
		FLAGS="-O2" ;;
 i686) 	LIBDIR=$LIBCONF32 
		FLAGS=$CF32;;
	*) 	LIBDIR=$LIBCONF32 
		FLAGS="-O2 -march=$ARCH -mtune=$ARCH";;
esac

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}

cd $PKG-$VER
	if [ "`which smake`" != "" ]; then
		export MAKE=smake
		smake
	else
		make
	fi
	SM=$(find smake -type f -name smake)
	if [ "$SM" ] ; then
		cp -fv $SM /usr/bin/
		install -d $CWD/${PKG}-install/usr/bin
		install -m 0755 $SM $CWD/${PKG}-install/usr/bin/
	fi
cd $CWD

package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
